{% load custom_tags %}
{% spaceless %}
<div class="pagination">
{% if page_numbers|length > 1 %}
    {% if show_first %}<a class="paginate_first" href="?{% query_string 'page' "1" %}" title="First Page">&laquo;</a>{% endif %}
    {% if has_previous %}<a class="paginate_previous" href="?{% query_string 'page' previous|stringformat:"i" %}" title="Previous Page">&lt;</a>{% endif %}
    {% for num in page_numbers %}
    {% if num == page %}
      <span class="paginate_link paginate_current" title="Current Page">{{ num }}</span>
    {% else %}
    <a class="paginate_link" href="?{% query_string 'page' num|stringformat:"i" %}" title="Page {{ num }}">{{ num }}</a>
    {% endif %}
    {% endfor %}
    {% if has_next %}<a class="paginate_next" href="?{% query_string 'page' next|stringformat:"i" %}" title="Next Page">&gt;</a>{% endif %}
    {% if show_last %}<a class="paginate_last" href="?{% query_string 'page' pages|stringformat:"i" %}" title="Last Page">&raquo;</a>{% endif %}
{% endif %}
{% if text %}
<div class="paginate_stats">
    (showing {{ results_per_page }} of {{ total_results }} {{ text }}{{ total_results|pluralize }})
</div>
{% endif %}
</div>
{% endspaceless %}
